﻿@using NTQOnlineExam.Services.Infrastructure.MVC
@using NTQOnlineExamFrontend.Models
@model NTQOnlineExamFrontend.Models.PortfolioViewModel


@if (Model.PortfolioDtos != null)
{
    foreach (var item in Model.PortfolioDtos)
    {
    <tr>
        <td>@item.TermId</td>
        <td>@item.TermName</td>
        <td>@item.OrderDateDisplay</td>
        <td>@item.ExpiredDateDisplay</td>
      @*  <td>@(item.LatestScore.HasValue ? item.LatestScore.Value.ToString() : string.Empty)</td>*@
        <td class="number">@(item.HighestScore.HasValue ? item.HighestScore.Value.ToString() : string.Empty)</td>
        <td>@if (item.IsTermPublished)
            {
            <a href="@Url.RouteUrl(new { Controller = "Member", Action = "Examination", selectedTerm = item.TermId })">Do exam</a>
            }
        </td>
    </tr>
    }
}
@*TODO: Use this to paging *@
||||||||

@{
    var pagingModel = new PagingModel
    {
        PageCount = Model.PageCount,
        SelectedPage = Model.SelectedPage,
        Href = string.Empty,
        OnClickFunction = "ChangePortfolioPage"
    };
    Html.RenderPartial("_Paging", pagingModel);
}
<script type="text/javascript">
    function ChangePortfolioPage(page) {
        $("#portfolio-selectedpage").val(page);
        NQTSort.RequestData();
    }
</script>
